package com.mbti.youmore.service;

import com.mbti.youmore.common.exception.PostNotExistException;
import com.mbti.youmore.entity.Post;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
* @author Guqier
* @description 针对表【t_post】的数据库操作Service
* @createDate 2024-05-08 20:30:45
*/
public interface PostService extends IService<Post> {

    Map<String, Object> getPostById(int userId, int postId) throws PostNotExistException;

    @Transactional // 启用事务
    int[] savePost(Post post) throws PostNotExistException;

    @Transactional
        // 启用事务
    int deletePost(int postId) throws PostNotExistException;

    List<Map<String, Object>> getPostSelf(int userId, int nowUserId) throws PostNotExistException;

    List<Map<String, Object>> getPostSelfFollow(int userId) throws PostNotExistException;
}
